﻿


using System;
using System.Collections.Generic;
using System.Collections;
using System.Runtime.Serialization;

namespace UFIDA.U9C.Cust.ZL.API.BaseData
{
    /// <summary>
    /// 返回值 DTO :自定义的数据传输类型 
    /// 
    /// </summary>
    public partial class ReturnDTO : UFSoft.UBF.Business.DTOBase
    {
        #region Constructor

        /// <summary>
        /// Constructor
        /// </summary>
        public ReturnDTO()
        {
            initData();
        }
        private void initData()
        {
            Code = 0;



        }

        #endregion

        #region Properties
        /// <summary>
        /// 编码 (该属性可为空,但有默认值)
        /// 返回值.Misc.编码
        /// </summary>
        /// <value>System.Int32</value>
        public System.Int32 Code
        {
            get
            {
                return (System.Int32)base.GetValue("Code", typeof(System.Int32));
            }

            set
            {
                base.SetValue("Code", value);
            }
        }
        /// <summary>
        /// 信息 (该属性可为空,且无默认值)
        /// 返回值.Misc.信息
        /// </summary>
        /// <value>System.String</value>
        public System.String Message
        {
            get
            {
                return (System.String)base.GetValue("Message", typeof(System.String));
            }

            set
            {
                base.SetValue("Message", value);
            }
        }
        /// <summary>
        /// 数据 (该属性可为空,且无默认值)
        /// 返回值.Misc.数据
        /// </summary>
        /// <value>System.String</value>
        public System.String Data
        {
            get
            {
                return (System.String)base.GetValue("Data", typeof(System.String));
            }

            set
            {
                base.SetValue("Data", value);
            }
        }

        #endregion
        #region Multi_Fields

        #endregion

        #region ModelResource
        /// <summary>
        /// 返回值的显示名称资源--已经废弃，不使用.
        /// </summary>
        public string Res_TypeName { get { return ""; } }
        /// <summary>
        /// 编码的显示名称资源 -- 已经废弃，不使用.
        /// </summary>
        public string Res_Code { get { return ""; } }
        /// <summary>
        /// 信息的显示名称资源 -- 已经废弃，不使用.
        /// </summary>
        public string Res_Message { get { return ""; } }
        /// <summary>
        /// 数据的显示名称资源 -- 已经废弃，不使用.
        /// </summary>
        public string Res_Data { get { return ""; } }
        #endregion




        #region EntityData exchange

        #region  Do SerializeKey -ForDTOType
        //反序化Key到Data的ID中　－－由FromEntityData自动调用，不处理层次关系
        private void DeSerializeKey(ReturnDTOData data)
        {




        }

        #endregion

        /// <summary>
        /// Copy Entity From EntityData
        /// </summary>
        public void FromEntityData(ReturnDTOData data)
        {
            this.FromEntityData(data, new Hashtable());
        }
        //used by ubf..
        public void FromEntityData(ReturnDTOData data, IDictionary dict)
        {
            if (data == null)
                return;
            if (dict == null) dict = new Hashtable();
            dict[data] = this;
            DeSerializeKey(data);

            this.Code = data.Code;

            this.Message = data.Message;

            this.Data = data.Data;

        }

        /// <summary>
        /// Create EntityData From Entity
        /// </summary>
        public ReturnDTOData ToEntityData()
        {
            return ToEntityData(null, new Hashtable());
        }
        /// <summary>
        /// Create EntityData From Entity - used by ubf 
        /// </summary>
        public ReturnDTOData ToEntityData(ReturnDTOData data, IDictionary dict)
        {
            if (data == null)
                data = new ReturnDTOData();
            if (dict == null)
                dict = new Hashtable();
            else
            {
                if (dict.Contains(this))
                {
                    data = (ReturnDTOData)dict[this];
                    return data;
                }
            }
            dict[this] = data;

            data.Code = this.Code;

            data.Message = this.Message;

            data.Data = this.Data;

            return data;
        }

        #endregion
    }

}